//
//  PPHttpRequest.m
//  dyseller
//
//  Created by 红喇叭 on 2017/8/10.
//  Copyright © 2017年 红喇叭. All rights reserved.
//

#import "PPHttpRequest.h"

@implementation PPHttpRequest

+ (PPHttpRequest*)requestStyle:(Requset_Style)style URL:(NSString *)url parameter:(NSDictionary *)param successBlock:(YYCommCompleteBlock)success failBlock:(YYCommErrorBlock)failure{
        PPHttpRequest *requset = [[PPHttpRequest alloc] init];
        requset.style = style;
        requset.requstUrl = url;
        requset.paramter = param;
        requset.success = success;
        requset.failure = failure;
    requset.isActive = NO;
    requset.response = [[HttpResponse alloc] init];
        return requset;
}
+ (PPHttpRequest *)requestStyle:(Requset_Style)style
                            URL:(NSString *)url
                      parameter:(NSDictionary *)param
                   successBlock:(YYCommCompleteBlock)success
                      failBlock:(YYCommErrorBlock)failure
                             active:(BOOL)isactive{
        PPHttpRequest *requset = [[PPHttpRequest alloc] init];
        requset.style = style;
        requset.requstUrl = url;
        requset.paramter = param;
        requset.success = success;
        requset.failure = failure;
        requset.isActive = isactive;
        requset.response = [[HttpResponse alloc] init];
        return requset;

    
}

+ (PPHttpRequest *)uploadImages:(Requset_Style)style
                            URL:(NSString *)url
                       isactive:(BOOL)active
                      imageData:(NSArray *)imageArray
                    imgfileName:(NSString *)filename
                      parameter:(NSDictionary *)param
                   successBlock:(YYCommCompleteBlock)success
                      failBlock:(YYCommErrorBlock)failure{
        PPHttpRequest *requset = [[PPHttpRequest alloc] init];
        requset.style = style;
        requset.requstUrl = url;
        requset.imgData = imageArray;
        requset.fileName = filename;
        requset.success = success;
        requset.failure = failure;
        requset.paramter = param;
        requset.isActive = active;
        requset.response = [[HttpResponse alloc] init];
        return requset;

}
@end
